import request from './request.js'

// 获取 品牌，CPU，内存，显卡
export const reqGetBrandModelType = (typeId) => {
  return request({
    method: 'GET',
    url: `/cinorecycle/model/by_human/select_brand_or_model_by_type/${typeId}`
  })
}

// 获取 型号
export const reqGetType = (typeId, brand) => {
  return request({
    method: 'GET',
    url: `/cinorecycle/model/by_human/select_brand_or_model_by_type/${typeId}/${brand}`
  })
}

// 获取多选备注
export const reqGetMarks = (typeId) => {
  return request({
    method: 'GET',
    url: `/cinorecycle/test-device-mark/marks/${typeId}`
  })
}
// 打印
export const reqPrintLogin = (deviceId, userId) => {
  return request({
    method: 'GET',
    url: `/cinorecycle/qr/${deviceId}/${userId}`
  })
}

export const reqPrintUnLogin = (deviceId) => {
  return request({
    method: 'GET',
    url: `/cinorecycle/qr/${deviceId}`
  })
}

// 获取所有用户
export const reqGetUsersPage = () => {
  return request({
    method: 'GET',
    url: '/cinorecycle/user/user',
    headers: {
      category: -1
    }

  })
}
// 获取设备
export const reqGetDevices = () => {
  return request({
    method: 'GET',
    url: '/cinorecycle/recycle-device-type/all'
  })
}
// 获取po
export const reqGetPos = (data) => {
  return request({
    method: 'POST',
    url: '/cinorecycle/business_project/get_po',
    data

  })
}
// 获取品牌
export const reqGetBrands = (typeId) => {
  return request({
    method: 'GET',
    url: `/cinorecycle/model/by_human/select_brand_or_model_by_type/${typeId}`

  })
}
// 获取型号
export const reqGetModels = (typeId, brand) => {
  return request({
    method: 'GET',
    url: `/cinorecycle/model/by_human/select_brand_or_model_by_type/${typeId}/${brand}`

  })
}
// 获取cpu
export const reqGetCPUs = (typeId) => {
  return request({
    method: 'GET',
    url: `/cinorecycle/model/by_human/select_brand_or_model_by_type/${typeId}`

  })
}

// 获取pc详情
export const reqGetPcDetail = (deviceId) => {
  return request({
    method: 'GET',
    url: `/cinorecycle/all-in-one/id/${deviceId}`
  })
}

// 更新pc
export const reqUpdatePC = (data) => {
  return request({
    method: 'PUT',
    url: '/cinorecycle/test-device-pc/pc',
    data
  })
}

// 删除某一项

export const reqDeleteItem = (deviceId, typeName) => {
  return request({
    method: 'DELETE',
    url: `/cinorecycle/test-device-pc/pc/${deviceId}/${typeName}`

  })
}
// 非手机类
export const reqGetCheckMarks = (typeId) => {
  return request({
    method: 'GET',
    url: `/cinorecycle/test-device-mark/marks/${typeId}`
  })
}

// 打印
export const reqPcPrint = (deviceId, userId) => {
  return request({
    method: 'GET',
    url: `/cinorecycle/all-in-one/print-qr/${deviceId}/${userId}`
  })
}

// 根据po获取类型和数量
export const reqGetTypeAndNumByPo = (poId) => {
  return request({
    method: 'GET',
    url: `/cinorecycle/all-in-one/id/po/${poId}`
  })
}

//添加硬盘
export const reqAddDisk = (params) => request({
  url: `/cinorecycle/test-device-pc/addDisk`,
  method: "POST",
  params
})
//添加内存
export const reqAddMemory = (params) => request({
  url: `/cinorecycle/test-device-pc/addMemory`,
  method: "POST",
  params
})

// 根据设备名称获取
export const reqGetSelectTypes = (deviceTypeName) => {
  return request({
    method: 'GET',
    url: `/cinorecycle/model/by_human/select_by_type_name/${deviceTypeName}`
  })
}